<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStoreBargainUserHelpsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('store_bargain_user_helps', function (Blueprint $table) {
            $table->id()->comment('砍价用户帮助表');
            $table->integer('user_id')->comment('帮助的用户id')->index();
            $table->integer('bargain_id')->comment('砍价商品ID')->index();
            $table->integer('bargain_user_id')->comment('用户参与砍价表id')->index();
            $table->decimal('price',8,2)->comment('砍掉的价格');
            $table->tinyInteger('type')->default(0)->comment('是否自己砍价【0:否 1:是】');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('store_bargain_user_helps');
    }
}
